package com.zbs.framework.dao.role.repository;

import com.zbs.framework.dao.role.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleRepository extends JpaRepository<Role, Integer>, JpaSpecificationExecutor<Role> {

    List<Role> findByName(String name);

    List<Role> findByNameAndType(String name,String type);

    Role findByIdAndEnabled(Integer id, Integer enabled);

    void deleteAllByType(String type);
}
